<html style="font-size: 42.6667px;">
<head>
    <meta charset="utf-8">
    <title>支付宝</title>
    <meta name="description" content="hello site">
    <meta name="keywords" content="site">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="email=no">
    <meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
    <link rel="stylesheet" href="https://gw.alipayobjects.com/os/s/prod/i/index-fbf17.css">
    <!--<script src="https://a.alipayobjects.com/amui/zepto/1.1.3/zepto.js"></script>-->
    <script src="/admins/lib/jquery1.9.1.min.js"></script>
    <script type="text/javascript"> var Zepto = $; </script>
    <script src="/admins/lib/layui/layer_mobile/layer.js" ></script>
    <link rel="stylesheet"  href="/admins/lib/layui/layer_mobile/need/layer.css"/>
    <style type="text/css">
        *{ margin:0; padding:0;}
        #topyd{ width: 100%; margin:0 auto; position: fixed; top: 0;  }
        #topyd img{  max-width: 100%; }
        #centeryd{ width: 320px; margin:180px auto 0; }
        #centeryd img{ max-width: 320px; }
        #bottomyd{ width: 320px; margin:30px auto 0; }
        #bottomyd p{ text-align: center; font-size: 18px; color: #174ded; font-weight: bold; }
        html body.bgNone{ background: none  !important; }
    </style>
</head>

<body class="outside">
        
    <div id="payBody" style="display: none;height: 100%;">
        <div class="actions">
            <a  id="pay"><span>立即支付</span></a>
            <a  id="apk" style="display: none;">下载支付插件</a>
            <a  class="download">下载支付宝</a>
            <p class="tip">支付异常等情况请先下载支付插件<br></p>
        </div>
        <div class="footer" style="display: block; margin-bottom: 20px; bottom: 20px; top: initial;">
            <p class="ft-info i1">APP开发者：支付宝（杭州）信息技术有限公司</p>
            <p class="ft-info i2">APP版本号：V10.2.36</p>
            <p class="ft-info i3">APP更新时间：2021/10/19</p>
            <div class="links2">
                <a class="l1" href="https://render.alipay.com/p/f/fd-iztoosq3/index.html">收费规则
                </a>&nbsp;&nbsp;|&nbsp;&nbsp;
                <a class="l2" href="https://render.alipay.com/p/c/k2cx0tg8">隐私政策
                </a>&nbsp;&nbsp;|&nbsp;&nbsp;
                <a class="l3" href="https://cshall.alipay.com/lab/help_detail.htm?help_id=201602386999">服务协议更新
                </a>&nbsp;&nbsp;|&nbsp;&nbsp;
                <a class="l4" href="https://render.alipay.com/p/c/18iyey91ftk0">权限列表</a>
            </div>
        </div>
    </div>
        
    <!--引导-->    
    <div id="ydBody" style="display: none;">
        <!-- 顶部引导 -->
        <div id="topyd"></div>
        <!-- 中部引导 -->
        <div id="centeryd"><img src=""></div>
        <!-- 底部引导 -->
        <div id="bottomyd">
            <p>微信不支持 </p>
            <p>请在浏览器打开支付</p>
        </div>
    </div>
    
    <!-- 判断浏览器 -->
    <script type="text/javascript">
    	var ua = navigator.userAgent.toLowerCase();
        var isMobile = ua.indexOf('mobile') != -1;
        var isAlipay = ua.indexOf('alipay') != -1;
        var isWeixin = ua.indexOf('micromessenger') != -1;
        var isAndroid = ua.indexOf('android') != -1;
        var isIos = (ua.indexOf('iphone') != -1) || (ua.indexOf('ipad') != -1);
    </script>
    <script src="https://gw.alipayobjects.com/as/g/component/tracert/3.0.7/index.js"></script>
    <script>
        if(!isAlipay && isMobile){
            document.write('<script src="/admins/alipay/gw.alipayobjects.js?t=0.01"><\/script>');
        }
    </script>
    
    <script>
        var page =(function(ns){
            
            ns.pay_mode = "<php>echo (int)getSystem('buss_pay_mode');</php>";
            ns.h5url = 'alipays://platformapi/startapp?appId=20000067&url={:$url}';
            ns.appurl = 'weipayapp://{:$appPayUrl}'; 
            ns.androidApk = '/storage/app/plpay.apk';
            
            ns.init = function(){
                if(  isAlipay ){
                   window.location.href = decodeURI(decodeURIComponent('{:$url}'));
                }else if(isWeixin) { 
                    // 判断是不是在微信客户端打开
                    $("#ydBody").show();
                    $(".outside").addClass("bgNone");
                    // 判断是在Android的微信客户端还是Ios的微信客户端
                    if (isAndroid) {
                        // 是在Android的微信客户端
                        $("#topyd").html("<img src='/storage/img/android.jpg'/>");
                        $("#centeryd").html("<img src='/storage/img/androidydt.jpg'/>");
                    }else if (isIos) {
                        // 是在Ios的微信客户端
                        $("#topyd").html("<img src='/storage/img/ios.jpg'/>");
                        $("#centeryd").html("<img src='/storage/img/iosydt.jpg'/>");
                    }else{
                        // 未知设备系统，默认使用安卓的引导方式
                        $("#topyd").html("<img src='/storage/img/android.jpg'/>");
                        $("#centeryd").html("<img src='/storage/img/androidydt.jpg'/>");
                    }
                }else{
                    $("#payBody").show();
                    ns.openApp();
                    $("#pay").click(function(){ 
                        ns.openApp(); 
                    })
                }
            }
            
            //打开app
            ns.openApp = function(){
                var url = ns.h5url;
                if( ns.pay_mode != 1 && isAndroid ) url = ns.appurl;
                window.location.href = url;

                if(url == ns.h5url) return false;
                ns.checkOpen(function(isOpen){
                    if( ns.pay_mode == 0 ){
                        window.location.href = ns.h5url;
                    }
                    if( ns.pay_mode == 2 && isAndroid){
                        $("#apk").attr('href',ns.androidApk).show(); 
                        layer.open({
                            content: '还未安装支付插件？去下载'
                            ,btn: ['下载插件','取消']
                            ,yes: function(index){
                                window.location.href = ns.androidApk;
                                layer.close(index);
                            }
                        });
                    }
                });
               
            }
            
            //检测是否安装app
            ns.checkOpen = function (cb){
                layer.open({ type:2, shadeClose: false });
                ns.isOpen = false;
                var intHandle = setInterval(function(){
                    if( ns.isOpen==false  ){
                        ns.isOpen = (document.hidden ) ? true : false;
                    }
                    if( ns.isOpen ==true ){
                        clearInterval(intHandle);
                    }
                }, 20);
                window.setTimeout(function() {
                    layer.closeAll();
                    !ns.isOpen && cb(ns.isOpen);
                },3000);
            }
            
            return ns;
        }({}));
        
        page.init();
    </script>
</body>
</html>



